libxl: events: timedereg internal unit test
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 3 Feb 2014 14:25:13 +0000 (14:25 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 6 Feb 2014 14:21:30 +0000 (14:21 +0000)
commit2920d6655a351e028591389a040a71039730788f
tree4a1d725458a5a253bc6edca13b3d5860210e5201
parenteb5cdc52756eb892c7da6b27c5a80d86d9df278a
libxl: events: timedereg internal unit test

Test timeout deregistration idempotency.  In the current tree this
test fails because ev->func is not cleared, meaning that a timeout
can be removed from the list more than once, corrupting the list.

It is necessary to use multiple timeouts to demonstrate this bug,
because removing the very same entry twice from a list in quick
succession, without modifying the list in other ways in between,
doesn't actually corrupt the list.  (Since removing an entry from a
doubly-linked list just copies next and back from the disappearing
entry into its neighbours.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
.gitignore
tools/libxl/Makefile
tools/libxl/libxl_test_timedereg.c [new file with mode: 0644]
tools/libxl/libxl_test_timedereg.h [new file with mode: 0644]
tools/libxl/test_timedereg.c [new file with mode: 0644]